package com.cndw.kungfu.config;

import java.util.HashMap;
import java.util.Map;

import com.cndw.kungfu.ext.NumberProcesser;

/**
 * 门派模块配置信息
 * 
 * @author fantadust [9677889@qq.com]
 * @date 2011-7-28 下午4:11:20
 */
public class DiscipleConfig {
	/**
	 * 重修的金币
	 */
	public static final int disciplePracticeGold = 8;
	/**
	 * 洗髓需要的金币
	 */
	public static final int discipleWashingGold = 68;
	/**
	 * 指定反映洗髓的价格
	 */
	public static final int discipleWashingSafeGold = 200;
	/**
	 * 各个天赋的几率 追加,减免,反射,吸收,暴击追加 ,攻速, 天资
	 */
	private static int[] dowerRate = { 200, 200, 150, 150, 250, 50 };
	/**
	 * 天赋几率基数
	 */
	private static int dowerRateBase = 1000;
	/**
	 * 徒弟天赋获得几率
	 */
	private static int[] levelRate100 = { 800, 150, 40, 10 };
	private static int[] levelRate35 = { 980, 20, 0, 0 };
	private static int[] levelRate75 = { 900, 80, 20, 0 };
	/**
	 * 徒弟天赋最多个数
	 */
	public static final int downNumMax = 3;

	/**
	 * 徒弟处长提升的几率
	 */
	private static int[] growthUpgradeRate = new int[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 65,
			60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 10, 10, 10, 10, 10, 10 };
	private static int[] growthFailureDown = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
			4, 5, 6, 7, 8, 9 };
	/**
	 * 特训需要的金币
	 */
	public static int[] devilGold = { 10, 50, 68, 92, 125, 170, 231, 314, 427, 580, 788, 1071, 1456, 1980, 2692, 3634, 4905, 6621, 8938, 12066 };
	/**
	 * 特训的加成
	 */
	public static int[] devilAdd = { 25, 75, 142, 232, 353, 516, 736, 1033, 1433, 1973, 2702, 3686, 5014, 6806, 9225, 11070, 12730, 14003, 14703, 15438 };
	/**
	 * 特训需要的银两
	 */
	public static int[] devilAsset = { 20000, 100000, 140000, 196000, 274400, 384160, 537824, 752953, 1054134, 1475787, 2066101, 2892541, 4049557, 5669379,
			7937130, 11111982, 15556774, 21779483, 30491276, 42687786 };
	/**
	 * 特训的次数
	 */
	public static int devilMaxTimes = 20;
	/**
	 * 重洗需要的元宝
	 */
	public static final int[] featureRefreshGold = { 50, 75 };
	/**
	 * 升级需要的元宝
	 */
	public static final int[] featureUpgreade = { 125, 1250, 3750 };
	public static final int[] featrueRefreshArr = { 650, 305, 37, 8 };

	public static Map<Integer, int[]> reinRate = new HashMap<Integer, int[]>();
	public static Map<Integer, int[]> reinFeature = new HashMap<Integer, int[]>();
	
	/**
	 * 徒弟洗点概率
	 */
	public static final int[][] rateWash = {{734, 150, 100, 10, 5, 1}, {495, 300, 150, 40, 10, 5}, {0, 450, 300, 150, 80, 20}};
	/**
	 * 徒弟洗点花费
	 */
	public static final int[] washCost = {150000, 40, 100};
	/**
	 * 徒弟洗点积分
	 */
	public static final int[] washScore = {1,3,5};
	
	/**
	 * 开启徒弟槽元宝
	 */
	public static final int discipleGridGold = 10;
	/**
	 * 开启徒弟槽银两
	 */
	public static final int discipleGridAsset = 12000;
	/**
	 * 徒弟槽最大经验值
	 */
	public static final int discipleGridExpMax = 980;
	/**
	 * 周游天下开放徒弟等级
	 */
	public static final int lv60Tour = 60;
	/**
	 * 御龙在天花费元宝
	 */
	public static final int[] tourDragonCost = {594, 686, 715, 806, 836, 941, 973, 1084, 1119, 1235, 1539, 1692, 1749,
			1910, 2079, 2135, 2308, 2375, 2573, 2759, 2959, 2977, 3070, 3150, 3231, 3320, 3407, 3380, 3467, 3552, 3644,
			3728, 3818, 3907, 3988, 4184, 4264, 4356, 4449, 4540, 4720, 5599, 6055, 7315, 7869, 9518, 10266,
			12558, 13503, 16893, 18119, 19359, 20768, 22126, 23650, 25275, 26927, 28685, 30586, 32459, 34547};
	/**
	 * 周游天下花费{银两，元宝}
	 */
	public static final int[] tourCost = {50000,88};
	/**
	 * 周游天下体力值
	 */
	public static final int tourPhysical = 24;
	/**
	 * 周游天下最大地点
	 */
	public static final int tourMax = 6;
	/**
	 * 周游天下升级停留降级概率{{银两获得},{元宝获得}}
	 */
	public static final int[][][] tourLvRate = {{{100, 0, 0}, {50, 50, 0}, {30, 50, 20}, {20, 50, 30}, {10, 50, 40}, {5, 50, 45}},
		{{100, 0, 0}, {80, 20, 0}, {60, 30, 10}, {40, 40, 20}, {20, 50, 30}, {10, 60, 30}}};
	/**
	 * 周游天下获得基础经验{{银两获得},{元宝获得}}
	 */
	public static final int[][] tourExpBase = {{0, 5750, 7000, 7750, 9000, 10250, 12500}, {0, 120395, 136675, 152954, 182234, 198512, 227792} };
	/**
	 * 周游天下暴击几率{{银两获得},{元宝获得}}
	 */
	public static final int[][] tourCritRate = {{10, 10, 10, 10, 10, 10}, {30, 30, 30, 30, 30, 30 }};

	/**
	 * 徒弟经验传承花费{徒弟等级，元宝，银两}
	 */
	public static final int[][] heritageExpCost = {{30, 10, 900000}, {40, 12, 1080000}, {50, 15, 1350000}, {60, 20, 1800000}, 
			{70, 25, 2250000}, {80, 30, 2700000}, {90, 35, 3150000}, {100, 50, 4500000}, {110, 140, 12600000}, {120, 400, 36000000}};
	/**
	 * 徒弟特训传承花费{特训次数，元宝，银两}
	 */
	public static final int[][] heritageDevilCost = {{1, 1, 5000}, {2, 5, 10000}, {3, 10, 20000}, {4, 15, 30000}, {5, 20, 50000}, 
			{6, 25, 80000}, {7, 30, 120000}, {8, 35, 170000}, {9, 40, 230000}, {10, 45, 300000}, {11, 50, 380000}, {12, 55, 470000}, 
			{13, 60, 570000}, {14, 65, 680000}, {15, 70, 790000}, {16, 75, 910000}, {17, 80, 1040000}, {18, 85, 1180000}, {19, 90, 1330000}, {20, 95, 1490000}};
	
	/**
	 * 徒弟武功加成
	 */
	public static int[][] gestAdd = { { 0, 0, 0, 0, 0, 0, 0, 0, 0 },// 初始
			{ 0, 1087, 2175, 3262, 4350, 5437, 6525, 7612, 8700, 9787 },// 1生命
			{ 0, 187, 375, 562, 750, 937, 1125, 1312, 1500, 1687 },// 2韧
			{ 0, 1087, 2175, 3262, 4350, 5437, 6525, 7612, 8700, 9787 },// 3气力
			{ 0, 787, 1575, 2362, 3150, 3937, 4725, 5512, 6300, 7087 },// 4防御
			{ 0, 187, 375, 562, 750, 937, 1125, 1312, 1500, 1687 },// 5命
			{ 0, 187, 375, 562, 750, 937, 1125, 1312, 1500, 1687 },// 6暴
			{ 0, 187, 375, 562, 750, 937, 1125, 1312, 1500, 1687 },// 7闪
			{ 0, 187, 375, 562, 750, 937, 1125, 1312, 1500, 1687 },// 8速
			{ 0, 787, 1575, 2362, 3150, 3937, 4725, 5512, 6300, 7087 },// 9攻击
	};
	public static Map<Integer, int[]> gestAddMap = new HashMap<Integer, int[]>(81);
	/**
	 * // 经验 银两 秒
	 */
	public static int[][] gestCost = { { 307648, 139840, 300 }, { 577534, 344020, 1800 }, { 1154200, 478400, 3600 }, { 1771027, 883920, 7200 },
			{ 3327823, 1308240, 14400 }, { 4903675, 2079000, 28800 }, { 6958797, 2797080, 36000 }, { 9873911, 3773000, 48000 }, { 14151826, 4854520, 60000 } };

	
	static {
		reinRate.put(0, new int[] { 9790, 200, 10, 0, 0 });
		reinRate.put(1, new int[] { 1600, 8000, 300, 80, 20 });// 悬赏招聘
		reinRate.put(2, new int[] { 0, 0, 9640, 230, 130 });

		reinFeature.put(0, new int[] { 8790, 1000, 200, 10, 0 });// 天赋配置
		reinFeature.put(1, new int[] { 0, 8000, 1500, 450, 50 });
		reinFeature.put(2, new int[] { 0, 5000, 3000, 1900, 100 });

		for (int i = 1; i <= 81; i++) {
			int[] addV = new int[10];
			int key = NumberProcesser.ceil(i, 9);
			int indexId = i % 9;
			indexId = indexId == 0 ? 9 : indexId;
			for (int j = 1; j <= 9; j++) {
				if (j <= indexId) {
					addV[j] = gestAdd[j][key];
				} else {
					addV[j] = gestAdd[j][key - 1];
				}
			}
			gestAddMap.put(i, addV);
		}

	}

	public static int[] getDowerRate() {
		return dowerRate;
	}

	public static int getDowerRateBase() {
		return dowerRateBase;
	}

	public static int[] getLevelRate100() {
		return levelRate100;
	}

	public static int[] getLevelRate35() {
		return levelRate35;
	}

	public static int[] getLevelRate75() {
		return levelRate75;
	}

	public static int[] getGrowthUpgradeRate() {
		return growthUpgradeRate;
	}

	public static int[] getGrowthFailureDown() {
		return growthFailureDown;
	}
	/**
	 * 是否招聘到特殊员工
	 * @return
	 */
	public static boolean openSpc(){
		return false;//T1ODO 10:30
	}

}
